//
//  YFNetworkingService.h
//  SquashSpark
//
//  Created by Coollang on 2017/11/4.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>
#import <Qiniu/QiniuSDK.h>
#import "YFCheckNetworkStatus.h"
#import "YFNetError.h"
#import "YFBaseRequest.h"

typedef void(^CRSNetworkingServiceBlock)(BOOL success,id result,NSError *error);

@interface YFNetworkingService : NSObject

/**单例*/
+ (instancetype)sharedInstance;

+ (QNUploadManager *)qNUploadManager;

-(void)configureBaseUrl;
- (void)cancelRequest:(YFBaseRequest *)request;
// 配置缓存
- (void)setUpRequestCacheFiltersWithUserId:(NSString *)userId;


/**
 *  普通请求
 *
 *  @param request 请求API
 *  @param block   回调
 */
-(void)sendRequest:(YFBaseRequest *)request
          callback:(CRSNetworkingServiceBlock)block;

/**
 *  并发请求
 *
 *  @param requestArray 请求队列
 *  @param block        回调block
 */
-(void)sendBatch:(NSArray *)requestArray
        callback:(CRSNetworkingServiceBlock)block;

/**
 提示APP更新
 */
-(void)updateAppRequest;

@end
